1. Field of the Invention
The present invention generally relates to an improved image-processing device for use in graphics display, and to an improved method of image-processing. In particular it relates to an image-processing device and a method of image-processing wherein no excessive fuzziness is generated when colour boundaries are interpolated.
2. Description of the Related Art
In computer graphics, objects are arranged in virtual space, after which texture is applied to the surface of the objects to represent the surface pattern. The process of creating a two-dimensional display image from this object data is known as `rendering`, while the image which results from rendering an object with applied texture is referred to as a `textured image`. During the process of rendering, an image as seen from the viewpoint position is created for each object in the virtual space. The texture of the object and the display image both consist of cells (unit areas) arranged vertically and horizontally, with the coloring designated cell by cell. The cells which constitute the texture are known as texture cells, while those which constitute the display image (picture) are called pixels.
A comparison between texture cells and pixels reveals that whereas pixels are arranged on the display image, texture cells are arranged irrespective of the pixels or viewpoint position in line with the direction of the surface of the object As a result, it is necessary during rendering to process (map) each texture cell of the object and allocate it to a pixel on the display image in accordance with the viewpoint position. This process is referred to as texture mapping. For instance, what is a perfect rectangle in virtual space must be mapped in a trapezoidal or rhombic shape on a display image which is viewed obliquely.
Texture mapping assumes a jaggy appearance if the texture is magnified in relation to the pixels. That is to say, if the viewpoint position is close to the object, the object is represented large on the display image, so that during texture mapping the texture of the object is expanded more than the pixels. Thus, inasmuch as the pixels are rectangular, the colour boundaries of the texture cells, which are the constituent units of texture, create a step-like or jaggy pattern on the display image (actual image), and may spoil it. The phenomenon whereby this jaggy appearance makes the image look unnatural is known as aliasing, and the term `anti-aliasing` refers to methods of preventing this.
Anti-aliasing to reduce the jaggy appearance is effected by means of interpolation of texture data. This interpolation involves blending (mixing) the colors of adjacent texture cells in order to obscure the difference. In this manner the step-like jaggy appearance ceases to be so prominent. A method known as a box filter has conventionally been employed in determining the area which is to be subject to interpolation. The box filter is the same size as a texture cell, and seeks to produce a texture image corresponding to pixels on the screen.
FIG. 12 illustrates the relationship between texture cells A, B, C, D and a conventional box filter F2. As the drawing shows, the conventional box filter F2 is a rectangular area defined as equal in size to the texture cells A, B, C, D. A color value, or data representing color. is defined for each of the texture cells A, B, C, D. Texture mapping utilizes the color values of the texture cells to determine the color values of each of the corresponding pixels.
In other words, for each of the texture cells A, B, C, D which overlap the box filter F2, the color values are blended in proportion to the area of overlap. This becomes the color value of the area which corresponds to the box filter F2, and is mapped on the pixels. For instance, if the box filter F2 is astride equal areas of black and white, the color value for the area of the box filter F2 becomes grey.
Of the four texture cells A, B. C, D which overlap the box filter F2 in the example illustrated in FIG. 12, the one with the greatest area of overlap is the texture cell C. This means that it is the color value of the texture cell C which will be reflected most prominently in the color value of the box filter F2.
Interpolation by means of a box filter in this manner is applied to the whole area or to the edge section of a texture cell by gradually increasing the x and y coordinates of the interpolation area. Thus, the color of adjoining sections of texture cells of the same color remains unchanged, while adjoining edge sections where the color is different are subject to gradation. As a result, color changes in the edge sections become smoother, and the jaggy appearance is reduced. The reason for adopting an integer-type box-shaped boundary when determining the targets of interpolation is that it is difficult for a computer, which depends on binary data (1 or 0), to calculate non-integer-type boundary shapes such as curved lines.
Interpolation makes it possible to prevent obvious jagginess, but where the magnification ratio increases for textures with well-defined lightness and darkness, it works beyond what is required. The result is that the edges of the texture image become too fuzzy, and this needs to be rectified.
In other words, the size of the box filter has conventionally been determined on the basis of the texture cell. This means that box filters which are applied to sections where the texture cells are considerably magnified in relation to the pixels are also magnified, and the extent of the fuzziness increases in proportion to the size of the box filter, For example, FIG. 14 demonstrates the results of conventional mapping of the texture illustrated in the preceding FIG. 13. The areas of intermediate color in FIG. 14 represent the extent of the fuzziness resulting from interpolation. At the back (the top in FIG. 14), where the magnification ratio is small, box filter size is small and therefore the extent of the fuzziness is not obvious This is not true, however, at the front (the bottom in FIG. 14), where the extent of the fuzziness determined by the box filter increases with the texture cell and becomes very obvious.
Thus, there has hitherto been a problem in that the edges (color boundaries) of texture with well-defined lightness and darkness have been excessively fuzzy where the magnification ratio was greatest, thus spoiling the image, For this reason it has been necessary to prepare texture data without excessive fuzziness for use in magnified display, with consequent problems of software and increased data area.